Class CF.NUR.MNISV3.Node Extends %Persistent
{

Property NodeName As %String(TRUNCATE = 1);

Property NodeCode As %String(TRUNCATE = 1);

Property HospitalId As %String(TRUNCATE = 1);

Property ProcessesId As %String(TRUNCATE = 1);

Property TemplateId As %String(TRUNCATE = 1);

Property NextNodes As %String(TRUNCATE = 1);

Property FirstFlag As %String(TRUNCATE = 1);

Property Request As %String(TRUNCATE = 1);

Property Behavior As %String(TRUNCATE = 1);

Property ModelCode As %String(TRUNCATE = 1);

Property SignFlag As %String(TRUNCATE = 1);

Index Code On (HospitalId, NodeCode);

Index Processes On (ProcessesId, FirstFlag);

Index NodeCode On NodeCode;

/// d ##class(CF.NUR.MNISV3.Node).Save("交接","Receive",2,"1","1","PutOrd","1")
/// d ##class(CF.NUR.MNISV3.Node).Save("摆药","PutOrd",2,"1","1","AuditDes","")
/// d ##class(CF.NUR.MNISV3.Node).Save("核对","AuditDes",2,"1","1","Despensing","")
/// d ##class(CF.NUR.MNISV3.Node).Save("配液","Despensing",2,"1","1","Puncture","")
/// d ##class(CF.NUR.MNISV3.Node).Save("输注","Puncture",2,"1","1","Tour|Suspend|Stop|Finish","")
/// d ##class(CF.NUR.MNISV3.Node).Save("巡视","Tour",2,"1","1","Tour|Suspend|Stop|Finish","")
/// d ##class(CF.NUR.MNISV3.Node).Save("暂停","Suspend",2,"1","1","Tour|Continue|Stop|Finish","")
/// d ##class(CF.NUR.MNISV3.Node).Save("继续","Continue",2,"1","1","Tour|Suspend|Stop|Finish","")
/// d ##class(CF.NUR.MNISV3.Node).Save("停止","Stop",2,"1","1","","")
/// d ##class(CF.NUR.MNISV3.Node).Save("结束","Finish",2,"1","1","","")
ClassMethod Save(Name As %String, Code As %String, HospitalId As %String, ProcessesId As %String, TemplateId As %String, NextNodes As %String, FirstFlag As %String) As %String
{
	
	s rw=$o(^CF.NUR.MNISV3.NodeI("Code"," "_HospitalId," "_$ZCVT(Code,"U"),""))
	i rw'="" s obj=##class(CF.NUR.MNISV3.Node).%OpenId(rw)
	e  s obj=##class(CF.NUR.MNISV3.Node).%New()
	
	s obj.NodeName =Name
	s obj.NodeCode=Code
	s obj.HospitalId=HospitalId
	s obj.ProcessesId=ProcessesId
	s obj.TemplateId=TemplateId
	s obj.NextNodes=NextNodes
	s obj.FirstFlag=FirstFlag
	d obj.%Save()
	q obj.%Id()
}

ClassMethod DeleteData(rw As %String) As %String
{
	q:rw="" 0
	s a=##class(CF.NUR.MNISV3.Node).%DeleteId(rw)
	q 1
}

Storage Default
{
<Data name="NodeDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>NodeName</Value>
</Value>
<Value name="3">
<Value>NodeCode</Value>
</Value>
<Value name="4">
<Value>HospitalId</Value>
</Value>
<Value name="5">
<Value>ProcessesId</Value>
</Value>
<Value name="6">
<Value>TemplateId</Value>
</Value>
<Value name="7">
<Value>NextNodes</Value>
</Value>
<Value name="8">
<Value>FirstFlag</Value>
</Value>
<Value name="9">
<Value>Request</Value>
</Value>
<Value name="10">
<Value>Behavior</Value>
</Value>
<Value name="11">
<Value>ModelCode</Value>
</Value>
<Value name="12">
<Value>SignFlag</Value>
</Value>
</Data>
<DataLocation>^CF.NUR.MNISV3.NodeD</DataLocation>
<DefaultData>NodeDefaultData</DefaultData>
<ExtentSize>10</ExtentSize>
<IdLocation>^CF.NUR.MNISV3.NodeD</IdLocation>
<IndexLocation>^CF.NUR.MNISV3.NodeI</IndexLocation>
<Property name="%%CLASSNAME">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="%%ID">
<AverageFieldSize>3</AverageFieldSize>
<Selectivity>1</Selectivity>
</Property>
<Property name="Behavior">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="FirstFlag">
<AverageFieldSize>2.1</AverageFieldSize>
<OutlierSelectivity>.9:</OutlierSelectivity>
<Selectivity>10.0000%</Selectivity>
</Property>
<Property name="HospitalId">
<AverageFieldSize>3</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="NextNodes">
<AverageFieldSize>14.3</AverageFieldSize>
<Selectivity>16.6667%</Selectivity>
</Property>
<Property name="NodeCode">
<AverageFieldSize>8.8</AverageFieldSize>
<Selectivity>10.0000%</Selectivity>
</Property>
<Property name="NodeName">
<AverageFieldSize>6</AverageFieldSize>
<Selectivity>10.0000%</Selectivity>
</Property>
<Property name="ProcessesId">
<AverageFieldSize>3</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="Request">
<AverageFieldSize>2</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<Property name="TemplateId">
<AverageFieldSize>3</AverageFieldSize>
<Selectivity>100.0000%</Selectivity>
</Property>
<SQLMap name="Code">
<BlockCount>-4</BlockCount>
</SQLMap>
<SQLMap name="IDKEY">
<BlockCount>-4</BlockCount>
</SQLMap>
<SQLMap name="NodeCode">
<BlockCount>-4</BlockCount>
</SQLMap>
<SQLMap name="Processes">
<BlockCount>-4</BlockCount>
</SQLMap>
<StreamLocation>^CF.NUR.MNISV3.NodeS</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}
